import Vue from 'vue'
import VueRouter from "vue-router";
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: () => import('@/views/Layout.vue'),
      redirect: '/article',
      children: [
        
        {
          path: '/article',
          component: () => import('@/views/Article.vue')
        },
        {
          path: '/Collect',
          name: 'Collect',
          component: () => import('@/views/Collect.vue')
        },
        {
          path: '/User',
          name: 'User',
          component: () => import('@/views/User.vue')
        },
        {
          path: '/Like',
          name: 'Like',
          component: () => import('@/views/Like.vue')
        }
      ]
    
    },
    {
      path: '/detail/:id?',
      name: 'detail',
      component: () => import('@/views/ArticleDetail.vue')
    }
    
  ]
})

export default router